<template>
  <div>
    <Header></Header>

    <!--主体-->
    <!-- 主体 -->
    <div class="banner">
      <div class="wrapper clearfix">
        <div class="celeInfo-left">
          <div class="avatar-shadow">
            <img class="avatar" :src="movedetail.poster" alt="" />
            <div class="movie-ver">
              <i class="imax2d">{{ movedetail.item.name }}</i>
            </div>
          </div>
        </div>
        <div class="celeInfo-right clearfix">
          <div class="movie-brief-container">
            <h1 class="name">{{ movedetail.name }}</h1>
            <div class="ename ellipsis">Embrace Again</div>
            <ul>
              <li class="ellipsis">
                <a class="text-link" href="">{{ movedetail.category }}</a>
              </li>
              <li class="ellipsis">
                {{ movedetail.nation }} /
                {{ movedetail.premiereAt | dateFilter }}分钟
              </li>
              <li class="ellipsis">
                {{ movedetail.premiereAt | dateFilter
                }}{{ movedetail.nation }}上映
              </li>
            </ul>
          </div>
          <div class="action-buyBtn">
            <div class="action clearfix">
              <a href="" class="wish">
                <div>
                  <i class="icon wish-icon"></i>
                  <span class="wish-msg">想看</span>
                </div>
              </a>
              <a href="" class="score-btn">
                <i class="icon score-btn-icon"></i>
                <span class="score-btn-msg">评分</span>
              </a>
            </div>
            <a class="btn buy" @click="gotocinema">特惠购票</a>
          </div>
          <div class="movie-stats-container">
            <div class="movie-index">
              <p class="movie-index-title">猫眼口碑</p>
              <div class="movie-index-content score normal-score">
                <span class="index-left info-num">
                  <span class="stonefont"> ?? </span>
                </span>
                <div class="index-right">
                  <div class="star-wrapper">
                    <div class="star-on" style="width: 95%"></div>
                  </div>
                </div>
                <span class="score-num">
                  <span class="stonefont">??万</span>
                  人评分
                </span>
              </div>
            </div>
            <div class="movie-index">
              <p class="movie-index-title">累计票房</p>
              <div class="movie-index-content box">
                <span class="stonwfont">??</span>
                <span class="unit">亿</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- 列表 -->
    <div class="container">
      <div class="main-content-container clearfix">
        <div class="main-content">
          <div class="tab-container tab-movie-info">
            <div class="crumbs-nav-container">
              <a href="">猫眼电影</a>
              <a href="">电影</a>
              <span>{{ movedetail.name }}</span>
            </div>
            <div class="tab-title-container clearfix">
              <div class="tab-title active">介绍</div>
              <div class="tab-title">演职人员</div>
              <div class="tab-title tab-disabled">奖项</div>
              <div class="tab-title">图集</div>
            </div>
            <div class="tab-content-container">
              <div class="tab-desc tab-content active">
                <div class="module">
                  <div class="mod-title">
                    <h2>剧情简介</h2>
                  </div>
                  <div class="mod-content">
                    <span class="dra">
                      {{ movedetail.synopsis }}
                    </span>
                  </div>
                </div>
                <div class="module">
                  <div class="mod-title">
                    <h2>演职人员</h2>
                    <a href="" class="more">全部</a>
                  </div>
                  <div class="mod-content">
                    <div class="celebrity-container clearfix">
                      <div class="celebrity-group">
                        <ul
                          class="celebrity-list clearfix"
                          v-for="(item, index) in movedetail.actors"
                          :key="index"
                        >
                          <li class="celebrity">
                            <a href="" class="portrait">
                              <img
                                class="default-img"
                                :src="item.avatarAddress"
                                alt=""
                              />
                            </a>
                            <div class="info">
                              <a href="" class="name">{{ item.name }}</a>
                              <a>{{ item.role }}</a>
                            </div>
                          </li>
                        </ul>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <low></low>
  </div>
</template>

<script>
import low from "../components/low";
import Header from "../components/Header";
import http from "../api/http";
import moment from "moment";
export default {
  name: "detail",
  data() {
    return {
      movedetail: null
    };
  },
  components: {
    low,
    Header
  },
  mounted() {
    http({
      url: `gateway?filmId=${this.$route.params.myid}&k=3869895`,
      headers: {
        "X-Host": "mall.film-ticket.film.info"
      }
    }).then(res => {
      if (res.status == 0) {
        console.log(res.data);
        let { film } = res.data;
        this.movedetail = film;
      }
    });
  },
  filters: {
    dateFilter(date) {
      return moment(date * 1000).format("YYYY-MM-DD");
    }
  },methods:{
    gotocinema(){
      this.$router.push('/cinema/'+this.$route.params.myid)
    }
  }
};
</script>
<style scoped>
/* 主体 */
.banner {
  width: 100%;
  min-width: 1200px;
  background: #392f59 url(../assets/detail/1.png) no-repeat 50%;
}
.banner .wrapper {
  width: 1200px;
  margin: 0 auto;
  height: 376px;
  position: relative;
}
.clearfix:after,
.clearfix:before {
  content: " ";
  display: table;
}
.banner .wrapper .celeInfo-left {
  width: 300px;
  float: left;
  position: relative;
  top: 70px;
  overflow: hidden;
  z-index: 9;
}
.celeInfo-left .avatar-shadow,
.cinema-left .avatar-shadow {
  position: relative;
  margin: 0 30px;
  width: 240px;
  height: 330px;
  padding-bottom: 40px;
  background: url(../assets/detail/2.png) no-repeat bottom;
}
.celeInfo-left .avatar-shadow .avatar {
  border: 4px solid #fff;
  height: 322px;
  width: 232px;
}
img {
  border-style: none;
}
.movie-ver {
  position: absolute;
  top: 4px;
  left: -2px;
  font-size: 12px;
  color: #fff;
}
.movie-ver i.imax2d {
  width: 69px;
  height: 25px;
  background-color: skyblue;
}
.movie-ver i {
  display: inline-block;
}
i {
  font-style: italic;
}
.banner .wrapper .celeInfo-right {
  position: relative;
  margin-right: 30px;
  margin-left: 300px;
  margin-top: 70px;
}
.movie-brief-container {
  position: absolute;
  color: #fff;
  font-size: 14px;
  z-index: 1;
}
.movie-brief-container .name {
  width: 900px;
  margin-top: 0;
  font-size: 26px;
  line-height: 32px;
  font-weight: 700;
  margin-bottom: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 64px;
}
.movie-brief-container .ename {
  width: 340px;
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 14px;
}
.ellipsis {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.movie-brief-container ul {
  width: 250px;
  list-style: none;
  padding-left: 0;
  margin-bottom: 20px;
}
.movie-brief-container ul li {
  margin: 12px 0;
  line-height: 100%;
}
.movie-brief-container a.text-link {
  color: inherit;
}
.action-buyBtn {
  position: absolute;
  bottom: 20px;
}
.action-buyBtn .btn.buy {
  margin-top: 10px;
  width: 250px;
  height: 40px;
  font-size: 16px;
  line-height: 40px;
  text-align: center;
  border-radius: 2px;
  padding: 0;
}
.btn {
  display: inline-block;
  padding: 2px 15px;
  line-height: 25px;
  font-size: 15px;
  color: #fff;
  background-color: #df2d2d;
}
.action-buyBtn .action a {
  cursor: pointer;
  float: left;
  display: block;
  width: 120px;
  height: 25px;
  background-color: #756189;
  margin-right: 10px;
  padding-top: 11px;
  text-align: center;
  font-size: 14px;
  line-height: 16px;
  color: #fff;
  border-radius: 2px;
}
.action-buyBtn .action .wish i.wish-icon {
  background: url(../assets/detail/4.png);
}
.action-buyBtn .action i.icon {
  display: inline-block;
  vertical-align: middle;
  margin-top: -2px;
  margin-right: 2px;
  width: 16px;
  height: 16px;
}
.action-buyBtn .action .score-btn i.score-btn-icon {
  background: url(../assets/detail/5.png);
}
.clearfix:after {
  clear: both;
}
.movie-stats-container {
  position: absolute;
  top: 158px;
  left: 342px;
}
.movie-stats-container .movie-index .movie-index-title {
  font-size: 12px;
  margin-bottom: 8px;
}
.movie-stats-container .movie-index .movie-index-content {
  overflow: hidden;
}
.movie-stats-container .movie-index .movie-index-content .index-left {
  float: left;
}
.movie-stats-container .movie-index .movie-index-content .info-num {
  font-size: 30px;
  color: #ffc600;
  height: 30px;
  line-height: 30px;
}
.stonefont {
  font-family: stonefont;
}
.movie-stats-container .movie-index .movie-index-content .index-right {
  margin-left: 54px;
  font-size: 12px;
}
.movie-stats-container .movie-index .movie-index-content .star-wrapper {
  width: 60px;
  height: 12px;
  position: relative;
  background-image: url(../assets/detail/6.png);
  background-repeat: repeat-x;
  margin-bottom: 4px;
}
.movie-stats-container .movie-index {
  margin-bottom: 16px;
  color: #fff;
}
.movie-stats-container .movie-index .movie-index-content {
  overflow: hidden;
}
.movie-stats-container .movie-index .box .stonefont {
  font-size: 30px;
}
.movie-stats-container .movie-index .box .unit {
  font-size: 12px;
  padding-left: 4px;
}

/* 列表 */
.container {
  width: 1200px;
  margin: 0 auto;
}
.main-content-container {
  margin-top: 80px;
}
.main-content-container > div.main-content {
  width: 730px;
  float: left;
}
.tab-container .crumbs-nav-container {
  margin-bottom: 25px;
  color: #333;
}
.tab-container .crumbs-nav-container a {
  color: inherit;
}
.tab-container .tab-title-container {
  border-bottom: 2px solid #eee;
}
.tab-container .tab-title-container .tab-title.active {
  color: #ef4238;
  border-bottom-color: #ef4238;
}
.tab-container .tab-title-container .tab-title {
  cursor: pointer;
  float: left;
  margin-right: 30px;
  margin-bottom: -2px;
  padding-bottom: 10px;
  font-size: 18px;
  color: #333;
  line-height: 100%;
  border-bottom: 2px solid transparent;
}
.tab-container .tab-title-container .tab-title.tab-disabled {
  color: #999;
  cursor: not-allowed;
}
.tab-container .tab-content-container .tab-content.active {
  display: block;
}
.tab-container .tab-content-container .tab-content {
  display: none;
}
.tab-desc {
  margin-top: 40px;
}
.module {
  position: relative;
  margin-bottom: 60px;
}

.module .mod-title h2 {
  display: inline-block;
  margin: 0;
  padding: 0;
  font-weight: 400;
  font-size: 18px;
  color: #333;
  line-height: 18px;
}
.module .mod-content {
  margin-top: 20px;
  color: #333;
}
.tab-desc .dra {
  font-size: 14px;
  line-height: 26px;
}
.module .mod-title .more {
  float: right;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  padding-right: 14px;
  background: url(../assets/detail/7.png) no-repeat 100%;
}
.celebrity-container {
  font-size: 16px;
  color: #333;
}
.tab-desc .celebrity-container .celebrity-group:first-child {
  margin-left: 0;
}
.tab-desc .celebrity-container .celebrity-group {
  float: left;
  margin-left: 30px;
}
.celebrity-container .celebrity-type {
  margin-bottom: 16px;
}
.celebrity-container .celebrity-list {
  margin-left: -20px;
}
.tab-desc .celebrity-container .celebrity-group .celebrity {
  margin-bottom: 0;
}
.celebrity-container .celebrity {
  float: left;
  width: 128px;
  margin-left: 20px;
  margin-bottom: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.celebrity-container .celebrity .portrait {
  margin-bottom: 6px;
  width: 128px;
  height: 170px;
  overflow: hidden;
}
.celebrity-container .celebrity .portrait img {
  width: 128px;
  height: 170px;
}
.default-img {
  background-image: url(../assets/detail/8.png);
  background-position: 50%;
  background-size: 68px 62px;
  background-repeat: no-repeat;
}
.celebrity-container .celebrity .name {
  margin-top: 8px;
  line-height: 1.2;
  color: #333;
}
.celebrity-container .celebrity .name,
.celebrity-container .celebrity .role {
  width: 54px;
  text-align: center;
  padding-bottom: 1px;
  margin-bottom: -1px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.tab-desc .celebrity-container .celebrity-group {
  float: left;
  margin-left: 30px;
  display: flex;
}
.celebrity-container .celebrity-type {
  margin-bottom: 16px;
}
.celebrity-container .celebrity-list {
  margin-left: 15px;
}
.celebrity-container .celebrity .role {
  font-size: 14px;
  line-height: 1.2;
  color: #666;
}
</style>
